package cn.lili.modules.system.client;

import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.page.entity.dos.PageData;
import cn.lili.modules.system.fallback.PageDataFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;

@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.SYSTEM_SERVICE, contextId = "pageData",fallback = PageDataFallback.class)
public interface PageDataClient {
    /**
     * 根据商品ID获取装修数据
     *
     * @param goodsId 商品ID
     * @return
     */
    @GetMapping("/feign/pageData/getList/{goodsId}")
    List<PageData> getListByGoodsId(@PathVariable("goodsId") String goodsId);

    @PostMapping("/feign/pageData/updatePageData")
    void updateByPageData(@RequestBody PageData pageData);
}
